<?php

use Illuminate\Database\Seeder;
use App\Permission;
class PermissionSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //添加相应的权限
      $permissiondata = [
          ['name'=>'登录后台权限','display_name'=>'system.login','description'=>'登陆后台权限'],
          ['name'=>'后台首页','display_name'=>'system.index','description'=>'后台首页'],
          ['name'=>'管理员控制','display_name'=>'system.manage','description'=>'管理员控制'],
          ['name'=>'显示车主列表','display_name'=>'cuser.list','description'=>'显示车主列表'],
          ['name'=>'创建车主','display_name'=>'cuser.create','description'=>'创建车主'],
          ['name'=>'删除车主','display_name'=>'cuser.destroy','description'=>'删除车主'],
          ['name'=>'修改车主','display_name'=>'cuser.edit','description'=>'修改车主列表'],
          ['name'=>'查看车主','display_name'=>'cuser.show','description'=>'查看车主'],
          ['name'=>'显示日志列表','display_name'=>'log.list','description'=>'显示日志列表'],
          ['name'=>'删除日志','display_name'=>'log.destroy','description'=>'删除日志'],
          ['name'=>'查看日志','display_name'=>'log.show','description'=>'查看日志'],
          ['name'=>'显示菜单列表','display_name'=>'menu.list','description'=>'显示菜单列表'],
          ['name'=>'创建菜单','display_name'=>'menu.create','description'=>'创建菜单'],
          ['name'=>'删除菜单','display_name'=>'menu.destroy','description'=>'删除菜单'],
          ['name'=>'修改菜单','display_name'=>'menu.edit','description'=>'修改菜单'],
          ['name'=>'查看菜单','display_name'=>'menu.show','description'=>'查看菜单'],
          ['name'=>'显示角色列表','display_name'=>'role.list','description'=>'显示角色列表'],
          ['name'=>'创建角色','display_name'=>'role.create','description'=>'创建角色'],
          ['name'=>'删除角色','display_name'=>'role.destroy','description'=>'删除角色'],
          ['name'=>'修改角色','display_name'=>'role.edit','description'=>'修改角色'],
          ['name'=>'查看角色权限','display_name'=>'role.show','description'=>'查看角色权限'],
          ['name'=>'显示权限列表','display_name'=>'permission.list','description'=>'显示权限列表'],
          ['name'=>'创建权限','display_name'=>'permission.create','description'=>'创建权限'],
          ['name'=>'删除权限','display_name'=>'permission.destroy','description'=>'删除权限'],
          ['name'=>'修改权限','display_name'=>'permission.edit','description'=>'修改权限'],
          ['name'=>'显示用户列表','display_name'=>'user.list','description'=>'显示用户列表'],
          ['name'=>'创建用户','display_name'=>'user.create','description'=>'创建用户'],
          ['name'=>'修改用户','display_name'=>'user.edit','description'=>'修改用户'],
          ['name'=>'删除用户','display_name'=>'user.destroy','description'=>'删除用户'],
          ['name'=>'修改用户密码','display_name'=>'user.reset','description'=>'修改用户密码'],


      ];
         foreach($permissiondata as $data){

             $permission = new Permission();
             $permission -> name = $data['name'];
             $permission -> display_name = $data['display_name'];
             $permission -> description = $data['description'];

             $permission -> save();
         }

    }
}
